OtpFieldColors

Colors of an OtpField, created with OtpFieldDefaults.colors. Use dynamic colors (the defaults are) so dark mode and Increase Contrast keep working. Checked pairs, resolved for the trait collection in use (opaque colors only; masked OtpMask.FilledCell cells use the border colors):

Violations are logged once and listed in contrastWarnings but never thrown, so brand colors remain usable. Disabled colors are exempt.

Properties

Link copied to clipboard
val cellBackground: UIColor
Link copied to clipboard
val cellBorder: UIColor
Link copied to clipboard

Contrast problems for the current trait collection, empty when compliant.

Link copied to clipboard
Link copied to clipboard
val disabledCellBorder: UIColor
Link copied to clipboard
val disabledText: UIColor
Link copied to clipboard
val errorCellBorder: UIColor
Link copied to clipboard
val errorText: UIColor
Link copied to clipboard
val focusedCellBorder: UIColor
Link copied to clipboard
val placeholder: UIColor
Link copied to clipboard
val text: UIColor

Functions

Link copied to clipboard
fun contrastWarningsIn(traits: UITraitCollection): List<String>

Contrast problems when the colors are resolved for traits, for example dark mode or Increase Contrast.